Import('env')

# app --deps--> libfoo.so --deps--> libbar.so

lib = env.SharedLibrary(
    target = 'bar',
    source = ['libbar.c'],
    RPATH = env['LIB_RPATH'],
)
env.Install('$LIB_DIR', lib)

lib = env.SharedLibrary(
    target = 'foo',
    source = ['libfoo.c'],
    LIBS = ['bar'],
    RPATH = env['LIB_RPATH'],
)
env.Install('$LIB_DIR', lib)

app = env.Program(
    target = 'app',
    source = ['app.c'],
    LIBS = ['foo'],
    RPATH = env['PROG_RPATH'],
)
env.Install('$BIN_DIR', app)
